package com.atom.plugin.core.test

import com.atom.plugin.core.AbstractPlugin
import com.atom.plugin.core.Log
import java.io.File
import java.util.jar.JarEntry

class PrintPlugin : AbstractPlugin<PrintExtension>() {

    override fun getExtensionName(): String {
        return this.javaClass.simpleName
    }

    override fun getExtensionClass(): Class<PrintExtension> {
        return PrintExtension::class.java
    }

    override fun transformDir(classBytes: ByteArray, inputFile: File, outputFile: File): ByteArray {
        Log.e("PrintPlugin >>> transformDir >>>> \n inputFile = ${inputFile.absolutePath}\n outputFile = ${outputFile.absolutePath}")
        return classBytes
    }

    override fun transformJar(
        classBytes: ByteArray,
        entry: JarEntry,
        inputFile: File,
        outputFile: File
    ): ByteArray {
        Log.e("PrintPlugin >>> transformJar >>>> \n entry = ${entry.name}\n inputFile = ${inputFile.absolutePath}\n outputFile = ${outputFile.absolutePath}")
        return classBytes
    }
}